╬πδαΓδσφΦσ

╨Φ±εΓαφΦσ Γ εΩφσ
╩εφ≥σΩ±≥ ε≥εß≡αµσφΦ 
╙±≥αφεΓΩα α≥≡Φß≤≥εΓ
╬∩≡σΣσδσφΦσ α≥≡Φß≤≥εΓ
╨Φ±εΓαφΦσ ⌠Φπ≤≡
└∩δσ≥ Draw
╚±⌡εΣφ√σ ≥σΩ±≥√
╧≡εσΩ≥ α∩δσ≥α

    ╩εφ≥σΩ±≥ ε≥εß≡αµσφΦ 

    ╧≡ε∙σ Γ±σπε ∩≡σΣ±≥αΓΦ≥ⁿ ±σßσ Ωεφ≥σΩ±≥ ε≥εß≡αµσφΦ  ΩαΩ ∩εδε≥φε, φα Ωε≥ε≡ε∞ ≡Φ±≤σ≥ ⌡≤ΣεµφΦΩ. ╥ε≈φε ≥αΩ µσ ΩαΩ ⌡≤ΣεµφΦΩ ∞εµσ≥ Γ√ßΦ≡α≥ⁿ Σδ  ≡Φ±εΓαφΦ  ≡ατδΦ≈φ√σ Φφ±≥≡≤∞σφ≥√, ∩≡επ≡α∞∞Φ±≥, ±ετΣα■∙ΦΘ α∩δσ≥ Java, ∞εµσ≥ Γ√ßΦ≡α≥ⁿ ≡ατδΦ≈φ√σ ∞σ≥εΣ√ Ωδα±±α Graphics Φ ταΣαΓα≥ⁿ ≡ατδΦ≈φ√σ α≥≡Φß≤≥√ Ωεφ≥σΩ±≥α ε≥εß≡αµσφΦ .

    ╠σ≥εΣ√ Ωδα±±α Graphics

    ┬ Ωα≈σ±≥Γσ ßατεΓεπε Σδ  Ωδα±±α Graphics (∩εδφεσ φατΓαφΦσ Ωδα±±α java.awt.Graphics) Γ√±≥≤∩ασ≥ Ωδα±± java.lang.Object.

    ╧≡σµΣσ Γ±σπε ∞√ ∩≡ΦΓσΣσ∞ ∩≡ε≥ε≥Φ∩√ Ωεφ±≥≡≤Ω≥ε≡α ²≥επε Ωδα±±α Φ σπε ∞σ≥εΣεΓ ± Ω≡α≥ΩΦ∞Φ Ωε∞∞σφ≥α≡Φ ∞Φ. ╧εδφεσ ε∩Φ±αφΦσ Γ√ ±∞εµσ≥σ φαΘ≥Φ Γ ²δσΩ≥≡εφφεΘ ΣεΩ≤∞σφ≥α÷ΦΦ, Ωε≥ε≡α  Γ⌡εΣΦ≥ Γ Ωε∞∩δσΩ≥ Java WorkShop.

    ─αδσσ ∞√ ≡α±±∞ε≥≡Φ∞ φατφα≈σφΦσ ε±φεΓφ√⌡ ∞σ≥εΣεΓ, ±π≡≤∩∩Φ≡εΓαΓ Φ⌡ ∩ε Γ√∩εδφ σ∞√∞ ⌠≤φΩ÷Φ ∞.

    ╩εφ±≥≡≤Ω≥ε≡

    • Graphics
    protected Graphics();

    ╠σ≥εΣ√

    • clearRect

    ╤≥Φ≡αφΦσ ±εΣσ≡µΦ∞επε ∩≡ ∞ε≤πεδⁿφεΘ εßδα±≥Φ

    public abstract void clearRect(int x, int y,
      int width, int height);
    • clipRect

    ╟αΣαφΦσ εßδα±≥Φ επ≡αφΦ≈σφΦ  Γ√ΓεΣα

    public abstract void clipRect(int x, int y,
      int width, int height);
    • copyArea

    ╩ε∩Φ≡εΓαφΦσ ±εΣσ≡µΦ∞επε ∩≡ ∞ε≤πεδⁿφεΘ εßδα±≥Φ

    public abstract void copyArea(int x, int y,
      int width, int height, int dx, int dy);
    • create

    ╤ετΣαφΦσ Ωεφ≥σΩ±≥α ε≥εß≡αµσφΦ 

    public abstract Graphics create();
    
    public Graphics create(int x, int y, 
      int width, int height);
    • dispose

    ╙ΣαδσφΦσ Ωεφ≥σΩ±≥α ε≥εß≡αµσφΦ 

    public abstract void dispose();
    • draw3DRect

    ╨Φ±εΓαφΦσ ∩≡ ∞ε≤πεδⁿφεΘ εßδα±≥Φ ± ≥≡σ⌡∞σ≡φ√∞ Γ√ΣσδσφΦσ∞

    public void draw3DRect(int x, int y, 
      int width, int height, boolean raised);
    • drawArc

    ╨Φ±εΓαφΦσ ±σπ∞σφ≥α

    public abstract void drawArc(int x, int y,
      int width, int height, 
      int startAngle, int arcAngle);

    ╨Φ±εΓαφΦσ ±σπ∞σφ≥α

    • drawBytes

    ╨Φ±εΓαφΦσ ≥σΩ±≥α Φτ ∞α±±ΦΓα ßαΘ≥

    public void drawBytes(byte data[], 
      int offset, int length, int x, int y);
    • drawChars

    ╨Φ±εΓαφΦσ ≥σΩ±≥α Φτ ∞α±±ΦΓα ±Φ∞ΓεδεΓ

    public void drawChars(char  data[], 
      int offset, int length, int x, int y);
    • drawImage

    ╨Φ±εΓαφΦσ ≡α±≥≡εΓεπε Φτεß≡αµσφΦ 

    public abstract boolean	drawImage(Image img,
      int x, int y, 
      Color bgcolor, ImageObserver observer);
    public abstract boolean	drawImage(Image img, 
      int x, int y, 
      ImageObserver observer);
    
    public abstract boolean	drawImage(Image img,
      int x, int y, 
      int width, int height, Color bgcolor, 
      ImageObserver observer);
    
    public abstract boolean	drawImage(Image img,
      int x, int y, 
      int width, int height,
      ImageObserver observer);
    • drawLine

    ╨Φ±εΓαφΦσ δΦφΦΦ

    public abstract void drawLine(int x1, int y1,
      int x2, int y2);
    • drawOval

    ╨Φ±εΓαφΦσ εΓαδα

    public abstract void drawOval(int x, int y, 
      int width, int height);
    • drawPolygon

    ╨Φ±εΓαφΦσ ∞φεπε≤πεδⁿφΦΩα

    public abstract void drawPolygon(
      int xPoints[], 
      int yPoints[], int nPoints);
    
    public void drawPolygon(Polygon p);	
    • drawRect

    ╨Φ±εΓαφΦσ ∩≡ ∞ε≤πεδⁿφΦΩα

    public void drawRect(int x, int y,
      int width, int height);
    • drawRoundRect

    ╨Φ±εΓαφΦσ ∩≡ ∞ε≤πεδⁿφΦΩα ± Ω≡≤πδ√∞Φ ≤πδα∞Φ

    public abstract void drawRoundRect(
      int x, int y, 
      int width, int height, 
      int arcWidth, int arcHeight);
    • drawString

    ╨Φ±εΓαφΦσ ≥σΩ±≥εΓεΘ ±≥≡εΩΦ

    public abstract void drawString(String str,
     int x, int y);
    • fill3DRect

    ╨Φ±εΓαφΦσ τα∩εδφσφφεπε ∩≡ ∞ε≤πεδⁿφΦΩα ± ≥≡σ⌡∞σ≡φ√∞ Γ√ΣσδσφΦσ∞

    public void fill3DRect(int x, int y, 
      int width, int height, boolean raised);
    • fillArc

    ╨Φ±εΓαφΦσ τα∩εδφσφφεπε ±σπ∞σφ≥α Ω≡≤πα

    public abstract void fillArc(int x,
        int y, int width,
        int height, int startAngle,
        int arcAngle);
    • fillOval

    ╨Φ±εΓαφΦσ τα∩εδφσφφεπε εΓαδα

    public abstract void fillOval(int x, int y, 
      int width, int height);
    • fillPolygon

    ╨Φ±εΓαφΦσ τα∩εδφσφφεπε ∞φεπε≤πεδⁿφΦΩα

    public abstract void fillPolygon(
      int xPoints[], 
      int yPoints[], int nPoints);
    • fillPolygon

    ╨Φ±εΓαφΦσ τα∩εδφσφφεπε ∞φεπε≤πεδⁿφΦΩα

    public void fillPolygon(Polygon p);	
    
    public abstract void fillRect(int x, int y,
      int width, int height);
    • fillRoundRect

    ╨Φ±εΓαφΦσ τα∩εδφσφφεπε ∩≡ ∞ε≤πεδⁿφΦΩα ± Ω≡≤πδ√∞Φ ≤πδα∞Φ

    public abstract void fillRoundRect(
      int x, int y, 
      int width, int height,
      int arcWidth, int arcHeight);
    • finalize

    ╧≡ε±δσµΦΓαφΦσ Γ√τεΓα ∞σ≥εΣα dispose

    public void finalize();	
    • getClipRect

    ╬∩≡σΣσδσφΦσ π≡αφΦ÷ εßδα±≥Φ επ≡αφΦ≈σφΦ  Γ√ΓεΣα

    public abstract Rectangle getClipRect();
    • getColor

    ╬∩≡σΣσδσφΦσ ÷Γσ≥α, Γ√ß≡αφφεπε Γ Ωεφ≥σΩ±≥ ε≥εß≡αµσφΦ 

    public abstract Color getColor();
    • getFont

    ╬∩≡σΣσδσφΦσ °≡Φ⌠≥α, Γ√ß≡αφφεπε Γ Ωεφ≥σΩ±≥ ε≥εß≡αµσφΦ 

    public abstract Font getFont();
    • getFontMetrics

    ╬∩≡σΣσδσφΦσ ∞σ≥≡ΦΩ ≥σΩ≤∙σπε °≡Φ⌠≥α

    public FontMetrics getFontMetrics();
    • getFontMetrics

    ╬∩≡σΣσδσφΦσ ∞σ≥≡ΦΩ ταΣαφφεπε °≡Φ⌠≥α

    public abstract FontMetrics 
      getFontMetrics(Font f);	
    • setColor

    ╙±≥αφεΓΩα ÷Γσ≥α Σδ  ≡Φ±εΓαφΦ  Γ Ωεφ≥σΩ±≥σ ε≥εß≡αµσφΦ 

    public abstract void setColor(Color c);
    • setFont

    ╙±≥αφεΓΩα ≥σΩ≤∙σπε °≡Φ⌠≥α Γ Ωεφ≥σΩ±≥σ ε≥εß≡αµσφΦ 

    public abstract void setFont(Font font);
    • setPaintMode

    ╙±≥αφεΓΩα ≡σµΦ∞α ≡Φ±εΓαφΦ 

    ╠σ≥εΣ setPaintMode ≤±≥αφαΓδΦΓασ≥ Γ Ωεφ≥σΩ±≥σ ε≥εß≡αµσφΦ  ≡σµΦ∞ ≡Φ±εΓαφΦ , ∩≡Φ Ωε≥ε≡ε∞ Γ√∩εδφ σ≥±  τα∞σ∙σφΦσ Φτεß≡αµσφΦ  ≥σΩ≤∙Φ∞ ÷Γσ≥ε∞, ≤±≥αφεΓδσφφε∞ Γ Ωεφ≥σΩ±≥σ ε≥εß≡αµσφΦ .

    public abstract void setPaintMode();
    • setXORMode

    ╙±≥αφεΓΩα ∞α±ΩΦ Σδ  ≡Φ±εΓαφΦ 

    ╟αΣαΓα  ∞α±Ω≤ Σδ  ≡Φ±εΓαφΦ  ∩≡Φ ∩ε∞ε∙Φ ∞σ≥εΣα setXORMode, Γ√ ∞εµσ≥σ Γ√∩εδφΦ≥ⁿ ∩≡Φ ≡Φ±εΓαφΦΦ τα∞σ∙σφΦσ ≥σΩ≤∙σπε ÷Γσ≥α φα ÷Γσ≥, ≤Ωαταφφ√Θ Γ ∩α≡α∞σ≥≡σ ∞σ≥εΣα, Φ φαεßε≡ε≥, ÷Γσ≥α, ≤Ωαταφφεπε Γ ∩α≡α∞σ≥≡σ ∞σ≥εΣα, φα ≥σΩ≤∙ΦΘ.

    ┬±σ ε±≥αδⁿφ√σ ÷Γσ≥α Φτ∞σφ ■≥±  φσ∩≡σΣ±Ωατ≤σ∞√∞ εß≡ατε∞, εΣφαΩε ²≥α ε∩σ≡α÷Φ  εß≡α≥Φ∞α, σ±δΦ Γ√ φα≡Φ±≤σ≥σ ≥≤ µσ ±α∞≤■ ⌠Φπ≤≡≤ ΣΓα ≡ατα φα εΣφε∞ Φ ≥ε∞ µσ ∞σ±≥σ.

    public abstract void setXORMode(Color c1);
    • translate

    ╤ΣΓΦπ φα≈αδα ±Φ±≥σ∞√ Ωεε≡ΣΦφα≥

    ╠σ≥εΣ translate ±ΣΓΦπασ≥ φα≈αδε ±Φ±≥σ∞√ Ωεε≡ΣΦφα≥ Γ Ωεφ≥σΩ±≥σ ε≥εß≡αµσφΦ  ≥αΩΦ∞ εß≡ατε∞, ≈≥ε εφε ∩σ≡σ∞σ∙ασ≥±  Γ ≥ε≈Ω≤ ± Ωεε≡ΣΦφα≥α∞Φ (x, y), ταΣαφφ√∞Φ ≈σ≡στ ∩α≡α∞σ≥≡√ ∞σ≥εΣα:

    public abstract void translate(int x, int y);
    • toString

    ╧εδ≤≈σφΦσ ≥σΩ±≥εΓεΘ ±≥≡εΩΦ, ∩≡σΣ±≥αΓδ ■∙σΘ Σαφφ√Θ Ωεφ≥σΩ±≥ ε≥εß≡αµσφΦ 

    public String toString();	


Java | ╧≡εΣ≤Ω≥√ Φ ≡σ°σφΦ  | ╥σ⌡φεδεπΦΦ | ╤σ≡ΓΦ± Φ εß≤≈σφΦσ
╬ Ωε∞∩αφΦΦ | ╧α≡≥φσ≡√ | ═εΓε±≥Φ | ╧εΦ±Ω
Sun Microsystems Inc. Corporate Information Our partners News and Events Search on site Java Computing Products and Solutions Technologies and Researches Education and Service Content